local yanzheng = fk.CreateSkill {
  name = "lingling__yanzheng",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lingling__yanzheng"] = "严整",
  [":lingling__yanzheng"] = "锁定技，当你于回合外被获得手牌后，你摸一张牌。",
}

yanzheng:addEffect(fk.AfterCardsMove, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(yanzheng.name) and player.room.current ~= player then
      for _, move in ipairs(data) do
        if move.from == player and move.to and move.to ~= player and move.moveReason == fk.ReasonPrey then
          for _, info in ipairs(move.moveInfo) do
            if info.fromArea == Card.PlayerHand then
              return true
            end
          end
        end
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, yanzheng.name)
  end,
})

return yanzheng
